package com.ruoyi.footprint.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.footprint.mapper.FootprintMapper;
import com.ruoyi.footprint.domain.Footprint;
import com.ruoyi.footprint.service.IFootprintService;

/**
 * 足迹记录Service业务层处理
 *
 * @author ch
 * @date 2021-11-24
 */
@Service
public class FootprintServiceImpl implements IFootprintService
{
    @Autowired
    private FootprintMapper footprintMapper;

    /**
     * 查询足迹记录
     *
     * @param id 足迹记录主键
     * @return 足迹记录
     */
    @Override
    public Footprint selectFootprintById(Long id)
    {
        return footprintMapper.selectFootprintById(id);
    }

    /**
     * 查询足迹记录列表
     *
     * @param footprint 足迹记录
     * @return 足迹记录
     */
    @Override
    public List<Footprint> selectFootprintList(Footprint footprint)
    {
        return footprintMapper.selectFootprintList(footprint);
    }

    /**
     * 新增足迹记录
     *
     * @param footprint 足迹记录
     * @return 结果
     */
    @Override
    public int insertFootprint(Footprint footprint)
    {
        footprint.setCreateTime(DateUtils.getNowDate());
        return footprintMapper.insertFootprint(footprint);
    }

    /**
     * 修改足迹记录
     *
     * @param footprint 足迹记录
     * @return 结果
     */
    @Override
    public int updateFootprint(Footprint footprint)
    {
        footprint.setUpdateTime(DateUtils.getNowDate());
        return footprintMapper.updateFootprint(footprint);
    }

    /**
     * 批量删除足迹记录
     *
     * @param ids 需要删除的足迹记录主键
     * @return 结果
     */
    @Override
    public int deleteFootprintByIds(Long[] ids,Long loginMemberId)
    {
        return footprintMapper.deleteFootprintByIds(ids,loginMemberId);
    }


    /**
     * 批量逻辑删除足迹记录
     *
     * @param ids 需要删除的足迹记录主键
     * @return 结果
     */
    @Override
    public int logicDeleteFootprint(Long[] ids,String delType,Long delUser)
    {
        return footprintMapper.logicDeleteFootprint(ids,delType,delUser);
    }

    /**
     * 删除足迹记录信息
     *
     * @param id 足迹记录主键
     * @return 结果
     */
    @Override
    public int deleteFootprintById(Long id)
    {
        return footprintMapper.deleteFootprintById(id);
    }
}
